package core
{
	import flash.display.Sprite;
	import flash.net.NetConnection;
	import flash.system.Security;
	
	import org.aisy.net.media.UNetStreamy;

	public class Main extends Sprite
	{
		private var __uNetStreamy:UNetStreamy;
		
		public function Main()
		{
			try {
				Security.allowDomain("*");
				Security.allowInsecureDomain("*");
			}
			catch (error:*) {}
		}
		
		public function getNetStream():UNetStreamy
		{
			if (null === __uNetStreamy) {
				var nc:NetConnection = new NetConnection();
				nc.connect(null);
				__uNetStreamy = new UNetStreamy(nc);
				__uNetStreamy.NAME = "UNETSTREAMY_IMOON";
				nc = null;
			}
			return __uNetStreamy;
		}
		
		public function getStream(a:*):*
		{
			a = getNetStream();
			return a;
		}
		
		public function clear():void
		{
			if (null !== __uNetStreamy) __uNetStreamy.clear();
			__uNetStreamy = null;
		}
		
	}
}